#include <atomic>
#include <iostream>
#include<string>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;


class compare
{
public:
    bool operator()(const pair<string, int>& x1, const pair<string, int>& x2)
    {
        return x1.second > x2.second;
    }


};




int main()
{
    vector<string> vt;
    string stmp;
    getline(cin, stmp, '.');
    size_t found = stmp.find(' ');
    string stm = stmp.substr(0, found);
    if (stm[0] < 'a')
    {
        stm[0] = (char)(stm[0] + 32);
    }
    while (found != string::npos)
    {
        vt.push_back(stm);
        size_t oldfound = found + 1;
        found = stmp.find(' ', found + 1);
        stm = stmp.substr(oldfound, found - oldfound);


        if (stm[0] < 'a')
        {
            stm[0] = (char)(stm[0] + 32);
        }

    }
    found = stmp.rfind(' ');
    stm = stmp.substr(found + 1);
    if (stm[0] < 'a')
    {
        stm[0] = (char)(stm[0] + 32);
    }
    vt.push_back(stm);




    map<string, int> mcount;
    for (auto& x : vt)
    {
        mcount[x]++;
    }
    vector<pair<string, int>> v(mcount.begin(), mcount.end());
    stable_sort(v.begin(), v.end(), compare());
    for (auto& x : v)
    {
        cout << x.first << ":" << x.second << endl;
    }





}
